#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>

void main()
{
    pid_t pid;
    char *message;
    int n;
    pid = fork();
    if(pid < 0)
    {
        perror("fork failed");
        exit(1);
    }
    if(pid == 0)
    {
        message = "this is the child \n";
        n  = 7;
    }
    else
    {
        message = "This is the parent\n";
        n = 3;
    }
    for(; n>0;n--)
    {
        printf(message);
        sleep(1);
    }
    return 0;
}
